package com.yayo.mangement.service.impl;

import com.yayo.mangement.dao.SysRoleDao;
import com.yayo.mangement.model.SysRoleDO;
import com.yayo.mangement.service.SysRoleService;
import com.yayo.mangement.paging.PageInfo;
import com.yayo.mangement.paging.Paging;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 
 * @author: Yayo
 * @date: 2020-08-07 14:10:31
 */
@Service
public class SysRoleServiceImpl implements SysRoleService{

    @Autowired
    private SysRoleDao sysRoleDao;

    @Override
    public Paging<SysRoleDO> paging(Integer pageNo, Integer pageSize,Map<String,Object> params){
        PageInfo pageInfo = new PageInfo(pageNo, pageSize);
        params.put("limit", pageInfo.getLimit());
        params.put("offset", pageInfo.getOffset());
        return sysRoleDao.paging(params);
    }

    @Override
    public SysRoleDO findById(Long id){
        return sysRoleDao.findById(id);
    }

    @Override
    public Boolean create(SysRoleDO sysRoleDO){
        return sysRoleDao.create(sysRoleDO);
    }

    @Override
    public Boolean updateById(SysRoleDO sysRoleDO){
        return sysRoleDao.update(sysRoleDO);
    }

    @Override
    public Boolean delete(Long id){
        return sysRoleDao.delete(id);
    }

}